package com.cyt.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.cyt.dao.impl.GongShiDaoImpl;
import com.cyt.dao.impl.LunBoTuDaoImpl;
import com.cyt.entity.GongShi;
import com.cyt.entity.LunBoTu;

//页眉 调用了 1.公司 2.轮播图 实现类
public class HeadServlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		GongShiDaoImpl cDao= new GongShiDaoImpl();//创建对象
	    GongShi g=cDao.getGongShi();//调用方法获得用户集合
	    request.setAttribute("g", g);
	    
	    LunBoTuDaoImpl lDao= new LunBoTuDaoImpl();//创建对象
	    List <LunBoTu> list=lDao.getLunBoTu();//调用方法获得用户集合
	   
	     request.setAttribute("lun", list);//将数据存入request中
	     
		request.getRequestDispatcher("head.jsp").include(request, response);
		
		
	   
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
